# -*- encoding:utf-8 -*-
"""
@作者：张福隆
@时间：2020/03/30
"""
import os
import time
import winsound

def checkNetwork():
    status = os.system('ping www.baidu.com')
    if status:
        print("没有网络!")
    else:
        print("连接成功!")
        sound()
def timer(n):
    while True:
        checkNetwork()
        time.sleep(n)
def sound():
    winsound.Beep(500,3000)

def main():
    timer(600) #秒

if __name__ == "__main__":
    main()









